package model;

/**
 *HouseHotelDebendency is a type of card that takes money for each house and hotel a player owns. 
 * @author Group 20
 */
public class HouseHotelDependency extends Expense
{
	private int numOfHouses, numOfHotels, payPerHouse, payPerHotel;

	/**
	 * The constructor adds values for Description, base pay, pay per house and pay per hotel
	 * @param description: Card description
	 * @param pay: base payment value
	 * @param payPerHouse: pay added per house
	 * @param payPerHotel: pay added per hotel
	 */
	public HouseHotelDependency(String description, int pay, int payPerHouse, int payPerHotel) {
		super(description, pay);
		this.payPerHouse = payPerHouse;
		this.payPerHotel = payPerHotel;
	}
    
	/**
	 * sets number of house for payment calculations.
	 * @param numOfHouses: the players number of houses
	 */
	public void setNumOfHouses(int numOfHouses) {
		this.numOfHouses = numOfHouses;
	}

	/**
	 * sets number of hotels for payment calculations.
	 * @param numOfHotels: the players number of hotels
	 */
	public void setNumOfHotels(int numOfHotels) {
		this.numOfHotels = numOfHotels;
	}

	/**
	 * To string method.
	 */
	@Override
	public String toString() {
		return "HouseHotelDependency ["+super.toString() +"]";
	}

	/**
	 * calculates the expense base on set variables.
	 */
	@Override
	public int calculateExpense() {
		return (numOfHouses*payPerHouse + numOfHotels*payPerHotel);
	}
	
}
